package com.ydl.learning.flink.demo.myFunction

import org.apache.flink.api.common.functions.RichMapFunction
import org.slf4j.{Logger, LoggerFactory}

/**
 *
 *
 * @author ydl
 * @since 2020/11/12
 */
class PrintFunction extends RichMapFunction[String, String] {
  private final val log: Logger = LoggerFactory.getLogger(classOf[PrintFunction])

  override def map(value: String): String = {
    log.info(value)
    //此处加sleep之后会发现，map的线程个数是由应用的并行度来决定的
    Thread.sleep(10000)
    value
  }
}
